--require("util.PrintUtil")

local Employee={
    attr_int_id=1,  --id
    attr_str_code="a012", --编号
    attr_str_age=12,  	--年龄
    attr_str_name="zhang san",  --xingming
    attr_date_birth={ year = 1970, month = 1, day = 1, hour = 8, min = 1 },	--生日
    attr_num_salary=2000.21,	--薪水
    attr_str_sex="female",	--性别

}

--local a = { a=1, b=2, c=3, d=4}
--printTable(a,1)
function Employee:new(o)
    o = o or {}  --新建继承者。 o是实际继承者
    setmetatable(o,self) -- 对象o调用不存在的成员时都会去self中查找，而这里的self指的就是Object
    self.__index = self --

    --local parent={}
    --parent.__index = self
    --
    --setmetatable(o,parent)
    return o
end


--工作
function Employee:work()
    print("employee name:"..(self.attr_str_name).." 未分配(实现)工作");
end
--开会
function Employee:meeting()
    print("employee name:"..(self.attr_str_name).." 普通会议参加");
end
--打印个人信息
function Employee:info()
    print("employee salary:"..(self.attr_num_salary).." name:".. self.attr_str_name .." id:".. self.attr_int_id.." code:".. self.attr_str_code.." birth:".. os.date("%Y-%m-%d %H:%M:%S'",os.time()));
end
--添加工作
function Employee:addWork(work)
    self.attr_list_work[#self.attr_list_work+1] = work;
    print("添加任务成功")
end

return Employee







